<template>
  <div :style="crumbsBox" class="crumbs-box flex-wrap flex-center-wrap">
    <div class="crumbs-content">
      当前位置：
      <template v-for="(item, index) in crumbs">
        <a
          v-if="index !== crumbs.length - 1"
          :href="parseFullPath(item.path)"
          :key="index"
        >
          {{ item.name }}&nbsp;/&nbsp;
        </a>
      </template>
      <span class="current-crumbs">{{ crumbs[crumbs.length - 1].name }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'crumbs_component',
  data() {
    return {}
  },
  props: {
    //面包屑数组
    crumbs: {
      type: Array,
      default: () => []
    },
    // 盒子样式
    crumbsBox: {
      type: Object,
      default: () => ({})
    }
  },
  mounted() {}
}
</script>

<style scoped>
.crumbs-box {
  height: 48px;
  background-color: #fff;
}
.crumbs-content {
  margin: 0 auto;
  width: 1200px;
  font-size: 12px;
  font-weight: 400;
  color: #999999;
  line-height: 17px;
}
a {
  text-decoration: none;
  color: inherit;
}
.current-crumbs {
  color: #383838;
}
</style>
